package com.heima.bootcom.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.heima.domain.Result;
import com.heima.domain.User;
import com.heima.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {
    @Reference
    private UserService userService;

    @RequestMapping("/findAll")
    public Result findAll(){
        List<User> all = userService.findAll();
        return new Result(all!=null?true:false,all);
    }
}
